package com.easylinkin.linkappapi.grid.models.vo;

import cn.hutool.core.util.NumberUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 周报汇总日报数据VO
 *
 * @author kyj
 * @date 2024/5/21 16:12
 */
@ApiModel(description = "周报汇总日报数据VO")
@Data
public class GridReportDayDetailWeekCollectVO implements Serializable {

    /**
     * 当日排查一般隐患（起）
     */
    @ApiModelProperty(value = "当日排查一般隐患（起）", position = 1)
    private Integer checkGeneralHazard;

    /**
     * 一般隐患整改（起）
     */
    @ApiModelProperty(value = "一般隐患整改（起）", position = 2)
    private Integer changeGeneralHazard;

    /**
     * 当日排查重大隐患（起）
     */
    @ApiModelProperty(value = "当日排查重大隐患（起）", position = 3)
    private Integer checkGreatHazard;

    /**
     * 重大隐患整改（起）
     */
    @ApiModelProperty(value = "重大隐患整改（起）", position = 4)
    private Integer changeGreatHazard;

    /**
     * 当日整改投入（万元）
     */
    @ApiModelProperty(value = "当日整改投入（万元）", position = 5)
    private BigDecimal changeInvestmentAmount;

    /**
     * 当日奖励个人（元）
     */
    @ApiModelProperty(value = "当日奖励个人（元）", position = 6)
    private BigDecimal rewardIndividualsAmount;

    /**
     * 汇总
     *
     * @param vo
     * @author kyj
     * @date 2024/5/21 17:27
     */
    public void collect(GridReportDayDetailInfoVO vo) {
        this.checkGeneralHazard = NumberUtil.add(checkGeneralHazard, vo.getCheckGeneralHazard()).intValue();
        this.changeGeneralHazard = NumberUtil.add(changeGeneralHazard, vo.getChangeGeneralHazard()).intValue();
        this.checkGreatHazard = NumberUtil.add(checkGreatHazard, vo.getCheckGreatHazard()).intValue();
        this.changeGreatHazard = NumberUtil.add(changeGreatHazard, vo.getChangeGreatHazard()).intValue();
        this.changeInvestmentAmount = NumberUtil.add(changeInvestmentAmount, vo.getChangeInvestmentAmount());
        this.rewardIndividualsAmount = NumberUtil.add(rewardIndividualsAmount, vo.getRewardIndividualsAmount());
    }
}
